//
//  LHCityCollectionViewCell.m
//  Knight_Tour
//
//  Created by Bruce_Lin on 15/5/15.
//  Copyright (c) 2015年 TouchOne. All rights reserved.
//

#import "LHCityCollectionViewCell.h"

@implementation LHCityCollectionViewCell

- (void)dealloc
{
    [_cityName release];
    [_cityPicView release];
    [_numberOfsight release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        [self creatView];
    }
    return self;
}

- (void)creatView
{
    self.cityPicView = [[UIImageView alloc]init];
    [self.contentView addSubview:_cityPicView];
    [_cityPicView release];
    
    self.cityName = [[UILabel alloc]init];
    _cityName.textAlignment = NSTextAlignmentCenter;
    _cityName.textColor = [UIColor colorWithRed:0.383 green:0.719 blue:0.904 alpha:1.000];
    [self.contentView addSubview:_cityName];
    [_cityName release];
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [_cityPicView setFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - 20)];
    
    [_cityName setFrame:CGRectMake(self.frame.size.width / 2 - 40, _cityPicView.frame.size.height + 5, 80,20)];
}

@end
